﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Globalization;
using System.Runtime.Serialization;
namespace GSLMS.Entity
{
	/// <summary>
	/// 2.3.15    立项申请调查报告信息主表
	/// </summary>
	[DataContract(IsReference = true)]
	public partial class TB_APP_PROREPORTINFO: IObjectWithChangeTracker, INotifyPropertyChanged
	{
		public TB_APP_PROREPORTINFO()
		{}
		#region Model
		private long _id;
		private long _proid;
		private long _reginfoid;
		private string _bussdetail;
		private string _regdetail;
		private string _corpname;
		private Nullable<DateTime> _createdate;
		private decimal _regcaptail;
		private string _legalman;
		private decimal _bussterm;
		private string _loanno;
		private string _conby;
		private string _anncheck;
		private string _regaddr;
		private string _regaddrtype;
		private string _regtelcode;
		private string _regtel;
		private string _regtelsub;
		private string _workaddr;
		private string _worktelcode;
		private string _worktel;
		private string _worktelsub;
		private int _isspecailcer;
		private string _havespecailcers;
		private string _legalhouaddr;
		private string _legaladdr;
		private string _legaltel;
		private string _legaltel2;
		private string _conbyaddr;
		private string _conbytel;
		private string _conbytel2;
		private string _otherremark;
		private string _surveyby;
		private Nullable<DateTime> _surveytime;
		private int _status;
		private int _sparefield1;
		private string _sparefield2;
		private string _sparefield3;
		/// <summary>
		/// 主键ID
		/// </summary>
		[DataMember]
		public long ID
		{
			get{return _id;}
			set{
				if ( _id!= value)
				{
					if (ChangeTracker.ChangeTrackingEnabled && ChangeTracker.State != ObjectState.Added)
					{
						throw new InvalidOperationException("属性“ID”是对象键的一部分，不可更改。仅当未跟踪对象或对象处于“已添加”状态时，才能对键属性进行更改。");
					}
					 _id = value;
					OnPropertyChanged("ID");
				}
			}
		}
		/// <summary>
		/// 立项申请记录ID
		/// </summary>
		[DataMember]
		public long PROID
		{
			get{return _proid;}
			set{
				if ( _proid!= value)
				{
					 _proid = value;
					OnPropertyChanged("PROID");
				}
			}
		}
		/// <summary>
		/// 申请登记记录ID
		/// </summary>
		[DataMember]
		public long REGINFOID
		{
			get{return _reginfoid;}
			set{
				if ( _reginfoid!= value)
				{
					 _reginfoid = value;
					OnPropertyChanged("REGINFOID");
				}
			}
		}
		/// <summary>
		/// 业务情况简述
		/// </summary>
		[DataMember]
		public string BUSSDETAIL
		{
			get{return _bussdetail;}
			set{
				if ( _bussdetail!= value)
				{
					 _bussdetail = value;
					OnPropertyChanged("BUSSDETAIL");
				}
			}
		}
		/// <summary>
		/// 注册情况
		/// </summary>
		[DataMember]
		public string REGDETAIL
		{
			get{return _regdetail;}
			set{
				if ( _regdetail!= value)
				{
					 _regdetail = value;
					OnPropertyChanged("REGDETAIL");
				}
			}
		}
		/// <summary>
		/// 企业名称
		/// </summary>
		[DataMember]
		public string CORPNAME
		{
			get{return _corpname;}
			set{
				if ( _corpname!= value)
				{
					 _corpname = value;
					OnPropertyChanged("CORPNAME");
				}
			}
		}
		/// <summary>
		/// 成立时间
		/// </summary>
		[DataMember]
		public Nullable<DateTime> CREATEDATE
		{
			get{return _createdate;}
			set{
				if ( _createdate!= value)
				{
					 _createdate = value;
					OnPropertyChanged("CREATEDATE");
				}
			}
		}
		/// <summary>
		/// 注册资本
		/// </summary>
		[DataMember]
		public decimal REGCAPTAIL
		{
			get{return _regcaptail;}
			set{
				if ( _regcaptail!= value)
				{
					 _regcaptail = value;
					OnPropertyChanged("REGCAPTAIL");
				}
			}
		}
		/// <summary>
		/// 法定代表人
		/// </summary>
		[DataMember]
		public string LEGALMAN
		{
			get{return _legalman;}
			set{
				if ( _legalman!= value)
				{
					 _legalman = value;
					OnPropertyChanged("LEGALMAN");
				}
			}
		}
		/// <summary>
		/// 经营期限
		/// </summary>
		[DataMember]
		public decimal BUSSTERM
		{
			get{return _bussterm;}
			set{
				if ( _bussterm!= value)
				{
					 _bussterm = value;
					OnPropertyChanged("BUSSTERM");
				}
			}
		}
		/// <summary>
		/// 贷款卡号
		/// </summary>
		[DataMember]
		public string LOANNO
		{
			get{return _loanno;}
			set{
				if ( _loanno!= value)
				{
					 _loanno = value;
					OnPropertyChanged("LOANNO");
				}
			}
		}
		/// <summary>
		/// 实际控制人
		/// </summary>
		[DataMember]
		public string CONBY
		{
			get{return _conby;}
			set{
				if ( _conby!= value)
				{
					 _conby = value;
					OnPropertyChanged("CONBY");
				}
			}
		}
		/// <summary>
		/// 年检情况
		/// </summary>
		[DataMember]
		public string ANNCHECK
		{
			get{return _anncheck;}
			set{
				if ( _anncheck!= value)
				{
					 _anncheck = value;
					OnPropertyChanged("ANNCHECK");
				}
			}
		}
		/// <summary>
		/// 注册地址
		/// </summary>
		[DataMember]
		public string REGADDR
		{
			get{return _regaddr;}
			set{
				if ( _regaddr!= value)
				{
					 _regaddr = value;
					OnPropertyChanged("REGADDR");
				}
			}
		}
		/// <summary>
		/// 注册地址类别
		/// </summary>
		[DataMember]
		public string REGADDRTYPE
		{
			get{return _regaddrtype;}
			set{
				if ( _regaddrtype!= value)
				{
					 _regaddrtype = value;
					OnPropertyChanged("REGADDRTYPE");
				}
			}
		}
		/// <summary>
		/// 注册地址电话区号
		/// </summary>
		[DataMember]
		public string REGTELCODE
		{
			get{return _regtelcode;}
			set{
				if ( _regtelcode!= value)
				{
					 _regtelcode = value;
					OnPropertyChanged("REGTELCODE");
				}
			}
		}
		/// <summary>
		/// 注册地址电话
		/// </summary>
		[DataMember]
		public string REGTEL
		{
			get{return _regtel;}
			set{
				if ( _regtel!= value)
				{
					 _regtel = value;
					OnPropertyChanged("REGTEL");
				}
			}
		}
		/// <summary>
		/// 注册地址电话分机号
		/// </summary>
		[DataMember]
		public string REGTELSUB
		{
			get{return _regtelsub;}
			set{
				if ( _regtelsub!= value)
				{
					 _regtelsub = value;
					OnPropertyChanged("REGTELSUB");
				}
			}
		}
		/// <summary>
		/// 办公地址
		/// </summary>
		[DataMember]
		public string WORKADDR
		{
			get{return _workaddr;}
			set{
				if ( _workaddr!= value)
				{
					 _workaddr = value;
					OnPropertyChanged("WORKADDR");
				}
			}
		}
		/// <summary>
		/// 办公地址电话区号
		/// </summary>
		[DataMember]
		public string WORKTELCODE
		{
			get{return _worktelcode;}
			set{
				if ( _worktelcode!= value)
				{
					 _worktelcode = value;
					OnPropertyChanged("WORKTELCODE");
				}
			}
		}
		/// <summary>
		/// 办公地址电话
		/// </summary>
		[DataMember]
		public string WORKTEL
		{
			get{return _worktel;}
			set{
				if ( _worktel!= value)
				{
					 _worktel = value;
					OnPropertyChanged("WORKTEL");
				}
			}
		}
		/// <summary>
		/// 办公地址电话分机号
		/// </summary>
		[DataMember]
		public string WORKTELSUB
		{
			get{return _worktelsub;}
			set{
				if ( _worktelsub!= value)
				{
					 _worktelsub = value;
					OnPropertyChanged("WORKTELSUB");
				}
			}
		}
		/// <summary>
		/// 是否需要特殊资质证书
		/// </summary>
		[DataMember]
		public int ISSPECAILCER
		{
			get{return _isspecailcer;}
			set{
				if ( _isspecailcer!= value)
				{
					 _isspecailcer = value;
					OnPropertyChanged("ISSPECAILCER");
				}
			}
		}
		/// <summary>
		/// 已取得资质证书
		/// </summary>
		[DataMember]
		public string HAVESPECAILCERS
		{
			get{return _havespecailcers;}
			set{
				if ( _havespecailcers!= value)
				{
					 _havespecailcers = value;
					OnPropertyChanged("HAVESPECAILCERS");
				}
			}
		}
		/// <summary>
		/// 法人代表实际住址
		/// </summary>
		[DataMember]
		public string LEGALHOUADDR
		{
			get{return _legalhouaddr;}
			set{
				if ( _legalhouaddr!= value)
				{
					 _legalhouaddr = value;
					OnPropertyChanged("LEGALHOUADDR");
				}
			}
		}
		/// <summary>
		/// 法定代表人实际住址
		/// </summary>
		[DataMember]
		public string LEGALADDR
		{
			get{return _legaladdr;}
			set{
				if ( _legaladdr!= value)
				{
					 _legaladdr = value;
					OnPropertyChanged("LEGALADDR");
				}
			}
		}
		/// <summary>
		/// 法定代表人手机1
		/// </summary>
		[DataMember]
		public string LEGALTEL
		{
			get{return _legaltel;}
			set{
				if ( _legaltel!= value)
				{
					 _legaltel = value;
					OnPropertyChanged("LEGALTEL");
				}
			}
		}
		/// <summary>
		/// 法定代表人手机2
		/// </summary>
		[DataMember]
		public string LEGALTEL2
		{
			get{return _legaltel2;}
			set{
				if ( _legaltel2!= value)
				{
					 _legaltel2 = value;
					OnPropertyChanged("LEGALTEL2");
				}
			}
		}
		/// <summary>
		/// 实际控制人实际住址
		/// </summary>
		[DataMember]
		public string CONBYADDR
		{
			get{return _conbyaddr;}
			set{
				if ( _conbyaddr!= value)
				{
					 _conbyaddr = value;
					OnPropertyChanged("CONBYADDR");
				}
			}
		}
		/// <summary>
		/// 实际控制人手机1
		/// </summary>
		[DataMember]
		public string CONBYTEL
		{
			get{return _conbytel;}
			set{
				if ( _conbytel!= value)
				{
					 _conbytel = value;
					OnPropertyChanged("CONBYTEL");
				}
			}
		}
		/// <summary>
		/// 实际控制人手机2
		/// </summary>
		[DataMember]
		public string CONBYTEL2
		{
			get{return _conbytel2;}
			set{
				if ( _conbytel2!= value)
				{
					 _conbytel2 = value;
					OnPropertyChanged("CONBYTEL2");
				}
			}
		}
		/// <summary>
		/// 其他情况说明
		/// </summary>
		[DataMember]
		public string OTHERREMARK
		{
			get{return _otherremark;}
			set{
				if ( _otherremark!= value)
				{
					 _otherremark = value;
					OnPropertyChanged("OTHERREMARK");
				}
			}
		}
		/// <summary>
		/// 调查人
		/// </summary>
		[DataMember]
		public string SURVEYBY
		{
			get{return _surveyby;}
			set{
				if ( _surveyby!= value)
				{
					 _surveyby = value;
					OnPropertyChanged("SURVEYBY");
				}
			}
		}
		/// <summary>
		/// 调查时间
		/// </summary>
		[DataMember]
		public Nullable<DateTime> SURVEYTIME
		{
			get{return _surveytime;}
			set{
				if ( _surveytime!= value)
				{
					 _surveytime = value;
					OnPropertyChanged("SURVEYTIME");
				}
			}
		}
		/// <summary>
		/// 状态
		/// </summary>
		[DataMember]
		public int STATUS
		{
			get{return _status;}
			set{
				if ( _status!= value)
				{
					 _status = value;
					OnPropertyChanged("STATUS");
				}
			}
		}
		/// <summary>
		/// 预留字段1
		/// </summary>
		[DataMember]
		public int SPAREFIELD1
		{
			get{return _sparefield1;}
			set{
				if ( _sparefield1!= value)
				{
					 _sparefield1 = value;
					OnPropertyChanged("SPAREFIELD1");
				}
			}
		}
		/// <summary>
		/// 预留字段2
		/// </summary>
		[DataMember]
		public string SPAREFIELD2
		{
			get{return _sparefield2;}
			set{
				if ( _sparefield2!= value)
				{
					 _sparefield2 = value;
					OnPropertyChanged("SPAREFIELD2");
				}
			}
		}
		/// <summary>
		/// 预留字段3
		/// </summary>
		[DataMember]
		public string SPAREFIELD3
		{
			get{return _sparefield3;}
			set{
				if ( _sparefield3!= value)
				{
					 _sparefield3 = value;
					OnPropertyChanged("SPAREFIELD3");
				}
			}
		}
		#endregion Model

	#region ChangeTracking
	   
	protected virtual void OnPropertyChanged(String propertyName)
	{
	    if (ChangeTracker.State != ObjectState.Added && ChangeTracker.State != ObjectState.Deleted)
	    {
	        ChangeTracker.State = ObjectState.Modified;
	    }
	    if (_propertyChanged != null)
	    {
	        _propertyChanged(this, new PropertyChangedEventArgs(propertyName));
	    }
	}
	   
	protected virtual void OnNavigationPropertyChanged(String propertyName)
	{
	    if (_propertyChanged != null)
	    {
	        _propertyChanged(this, new PropertyChangedEventArgs(propertyName));
	    }
	}
	   
	event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged{ add { _propertyChanged += value; } remove { _propertyChanged -= value; } }
	private event PropertyChangedEventHandler _propertyChanged;
	private ObjectChangeTracker _changeTracker;
	   
	[DataMember]
	public ObjectChangeTracker ChangeTracker
	{
	    get
	    {
	        if (_changeTracker == null)
	        {
	            _changeTracker = new ObjectChangeTracker();
	            _changeTracker.ObjectStateChanging += HandleObjectStateChanging;
	        }
	        return _changeTracker;
	    }
	    set
	    {
	        if(_changeTracker != null)
	        {
	            _changeTracker.ObjectStateChanging -= HandleObjectStateChanging;
	        }
	        _changeTracker = value;
	        if(_changeTracker != null)
	        {
	            _changeTracker.ObjectStateChanging += HandleObjectStateChanging;
	        }
	    }
	}
	   
	private void HandleObjectStateChanging(object sender, ObjectStateChangingEventArgs e)
	{
	    if (e.NewState == ObjectState.Deleted)
	    {
	        ClearNavigationProperties();
	    }
	}
	   
	protected bool IsDeserializing { get; private set; }
	   
	[OnDeserializing]
	public void OnDeserializingMethod(StreamingContext context)
	{
	    IsDeserializing = true;
	}
	   
	[OnDeserialized]
	public void OnDeserializedMethod(StreamingContext context)
	{
	    IsDeserializing = false;
	    ChangeTracker.ChangeTrackingEnabled = true;
	}
	   
	protected virtual void ClearNavigationProperties()
	{
	}
	
	#endregion

	}
}

